package com.web.pojo.vo;

import com.web.utils.ToolUtil;

import java.util.Arrays;

/**
 * @Author: wws
 * describe:
 */
public class GetSwitchDeviceInfo {
    private Integer id;
    private Byte communicationType;//通信类型
    private String upstreamChannel;//上行通道
    private String versionNumber;//版本号
    private Byte productNumber;//产品型号

    public GetSwitchDeviceInfo() {
    }

    public GetSwitchDeviceInfo(Integer deviceId, byte[] data) {
        this.id = deviceId;
        this.communicationType = data[5];
        this.upstreamChannel = ToolUtil.printHexBinary(Arrays.copyOfRange(data, 6, 8));
        this.versionNumber = ToolUtil.printHexBinary(Arrays.copyOfRange(data, 7, 13));
        this.productNumber = data[13];
    }

    public GetSwitchDeviceInfo(Integer id, Byte communicationType, String upstreamChannel, String versionNumber, Byte productNumber) {
        this.id = id;
        this.communicationType = communicationType;
        this.upstreamChannel = upstreamChannel;
        this.versionNumber = versionNumber;
        this.productNumber = productNumber;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Byte getCommunicationType() {
        return communicationType;
    }

    public void setCommunicationType(Byte communicationType) {
        this.communicationType = communicationType;
    }

    public String getUpstreamChannel() {
        return upstreamChannel;
    }

    public void setUpstreamChannel(String upstreamChannel) {
        this.upstreamChannel = upstreamChannel;
    }

    public String getVersionNumber() {
        return versionNumber;
    }

    public void setVersionNumber(String versionNumber) {
        this.versionNumber = versionNumber;
    }

    public Byte getProductNumber() {
        return productNumber;
    }

    public void setProductNumber(Byte productNumber) {
        this.productNumber = productNumber;
    }

    @Override
    public String toString() {
        return "GetSwitchDeviceInfo{" +
                "id=" + id +
                ", communicationType=" + communicationType +
                ", upstreamChannel='" + upstreamChannel + '\'' +
                ", versionNumber='" + versionNumber + '\'' +
                ", productNumber=" + productNumber +
                '}';
    }
}
